package com.yao.club.controller;

import com.yao.club.entity.dto.MallAd;
import com.yao.club.entity.result.ResponseEntity;
import com.yao.club.utils.ResponseUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/app/ad")
@Api(value = "广告模块", description = "广告模块", tags = "广告模块")
public class AdController {

    @ApiOperation(value = "获取广告列表", notes = "返回固定的广告列表数据")
    @GetMapping("/list")
    public ResponseEntity<List<MallAd>> getAdList() {
        // 构造固定的广告数据
        List<MallAd> ads = new ArrayList<>();

        MallAd ad1 = new MallAd();
        ad1.setId(75);
        ad1.setImageUrl("https://jystest-resource.iwubida.com/smartdms/2024/09/2zVRcKTJBZgTZ4Typwjr-.png");
        ad1.setName("骑士节");
        ad1.setProductType("");
        ad1.setType("out");
        ad1.setUrl("http://iov.cineco.cc:10008/mobile/prize");

        MallAd ad2 = new MallAd();
        ad2.setId(151);
        ad2.setImageUrl("https://jystest-resource.iwubida.com/smartdms/2024/08/O-Kx_IuI7JG5Yt-8aC5uj.JPG");
        ad2.setName("启动页抽奖");
        ad2.setProductType("");
        ad2.setType("out");
        ad2.setUrl("http://iov.cineco.cc:10008/mobile/prize");

        ads.add(ad1);
        ads.add(ad2);

        // 返回广告列表
        return ResponseUtils.success(ads);
    }
}